//调用接口配置文件
import { request } from 'config/request'
import config from 'config/config'
// 定义接口

//新增
export async function addFun(params) {
    return request({
        url: `${config.aheadPlan}admin/competitorWeekly/competitorWeekly/save`,
        method: 'POST',
        data: params,
    });
  };

//查询
export async function queryInfo(params) {
    return request({
        url: `${config.aheadPlan}admin/competitorWeekly/competitorWeekly/queryById`,
        method: 'GET',
        data: params,
    });
  };

//查询竞品信息
export async function findCometingGoods(params) {
  return request({
      url: `${config.aheadPlan}admin/competitorWeekly/competitorWeekly/findCometingGoods`,
      method: 'GET',
      data: params,
  });
};

//  //获取城市
//  export async function findByCity(params) {
//   return request({
//       url: `${config.aheadPlan}admin/competitorWeekly/competitorWeekly/findByCity`,
//       method: 'GET',
//       data: params,
//   });
// };

//  //获取项目
//  export async function findByProject(params) {
//   return request({
//       url: `${config.aheadPlan}admin/competitorWeekly/competitorWeekly/findByProject`,
//       method: 'GET',
//       data: params,
//   });
// };
//获取区域
export async function getProjectPermission(params) {
  return request({
      url: `${config.aheadPlan}system/login/getProjectPermission?userId=${params.userId}`,
      method: 'GET',
  });
};

//获取环比
export async function getPriceRatio(params) {
  return request({
      url: `${config.aheadPlan}admin/competitorWeekly/competitorWeekly/getPriceRatio`,
      method: 'GET',
      data: params,
  });
};
 //获取城市
 export async function findByCity(params) {
  return request({
      url: `${config.aheadPlan}admin/competitorWeekly/competitorWeekly/findByCity`,
      method: 'GET',
      data: params,
  });
};
